home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ansi / hercules.zip / HERCBIOS.DOC < prev    next >
Text File  |  1986-09-04  |  10KB  |  240 lines

  1.  
  2.  
  3.                              *****   HERCBIOS   *****
  4.                         BIOS PATCH FOR THE HERCULES BOARD
  5.  
  6.                                Dave Tutelman  1986
  7.  
  8.  
  9.  
  10.           The accompanying program is a front end to the INT 10 (VIDEO)
  11.         functions of the DOS BIOS, so that the important functions work
  12.         on a Hercules graphics board or its clones. (It was developed on
  13.         a SuperComputer clone of a Hercules) It is a
  14.         terminate-and-stay-resident program, that is installed by being
  15.         called; it is NOT a DOS driver. If you want it installed at boot,
  16.         include it in AUTOEXEC.BAT, not CONFIG.SYS.
  17.  
  18.         WHAT IT'S GOOD FOR
  19.  
  20.         The major strength of this program is that it will allow you to
  21.         write programs for the Hercules board that run in graphics mode,
  22.         and still write text easily on the graphics screen. With it, you
  23.         can program in those higher-level language processors that use
  24.         the DOS or BIOS calls for display, using their standard I/O calls
  25.         to write text to the graphics screen. (For a list of known
  26.         compatible and incompatible languages, see the section later in
  27.         this manual.)
  28.  
  29.         A second use of this program is to allow the running of existing
  30.         graphics programs that use the BIOS calls for ALL screen display.
  31.         It will NOT allow most commercial graphics programs written for
  32.         the the Color Graphics Adapter (CGA) to run on the Hercules
  33.         board. That is because most graphics programs write directly to
  34.         the video memory instead of using the BIOS calls. The only
  35.         existing graphics program that this has been tested against is
  36.         PC-LISP; that is the only graphics program I've encountered that
  37.         uses the BIOS exclusively.
  38.  
  39.  
  40.         HOW IT WORKS
  41.  
  42.         HERCBIOS is a terminate-and-stay-resident program that intercepts
  43.         all calls to Interrupt 10H, the BIOS video services. It will
  44.         either process the interrupt or pass the call on to the real
  45.         BIOS, depending on whether something specific to the Hercules
  46.         board needs to be done. Specifically, HERCBIOS handles the
  47.         interrupt itself if (1) the board is in graphics mode, or (2) the
  48.         BIOS call is a request to enter graphics mode.
  49.  
  50.         Two graphics modes are recognized and processed by HERCBIOS:
  51.  
  52.              Mode 6 - IBM Hi-res mode:  This uses part of the 720x348
  53.              Hercules raster as a 640x200 IBM-compatible graphics screen.
  54.              It will work with programs for the IBM CGA and its clones,
  55.              provided they use the BIOS services for their graphics
  56.              display. (Note - such programs are rare.)
  57.  
  58.              Mode 8 - Hercules-specific mode:  This uses the full
  59.  
  60.                                       - 1 -
  61.  
  62.  
  63.              Hercules raster.
  64.  
  65.         Actually, both modes are quite capable of putting a pixel
  66.         anywhere on the Hercules raster.  The major difference is that
  67.         Mode 6 draws characters in an 8x8 pixel box (like the CGA), while
  68.         Mode 8 uses the finer resolution of the Hercules board to improve
  69.         legibility by using a 12x8 pixel box for characters. In either
  70.         mode, more characters than 25x80 will fit on the screen. Mode 6
  71.         supports 43x90 characters on the screen (but 25x80 inside the
  72.         640x200-pixel sub-screen); Mode 8 supports 29x90 characters.
  73.  
  74.         The functions implemented by HERCBIOS are:
  75.  
  76.                 Fn  0 - Set mode (6, 7, or 8)
  77.                 Fn  2 - Set cursor position
  78.                 Fn  3 - Read cursor position
  79.                 Fn  5 - New display page
  80.                 Fn  9 - Write character with attribute
  81.                 Fn 10 - Write character
  82.                 Fn 12 - Write pixel
  83.                 Fn 13 - Read pixel
  84.                 Fn 14 - Teletypewriter-style character write
  85.                 Fn 15 - Get video status
  86.  
  87.         Check your System Programmers' Guide for the use of these BIOS
  88.         functions.
  89.  
  90.         A number of properties of the alphanumeric display are not
  91.         supported by the hardware when you enter graphics mode. For
  92.         instance, the cursor is not shown in graphics mode, nor are all
  93.         of the character attributes. HERCBIOS does its best to emulate
  94.         the alphanumeric mode, but it cannot implement a cursor or the
  95.         blinking or bold attributes. The table below shows the "best
  96.         shot" that HERCBIOS takes at character attributes:
  97.  
  98.                 CODE    USUALLY MEANS           IBM MODE        HERC MODE
  99.                 00      invisible               invisible       invisible
  100.                 01      underline               [normal]        underline
  101.                 07      normal                  normal          normal
  102.                 0F      hi-intens               [rev video]     [rev video]
  103.                 70      rev video               rev video       rev video
  104.  
  105.  
  106.                 Anything else displays as normal
  107.  
  108.         The teletypewriter-style output protects the bottom line on the
  109.         screen as an unscrolled line, for status messages, function key
  110.         labels, etc. This is non-standard, but I like it. (And we do have
  111.         more rows than the CGA display. It's the 43rd line that isn't
  112.         scrolled.)
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.                                       - 2 -
  121.  
  122.  
  123.         MAKING AND INSTALLING THE PROGRAM
  124.         Making the .COM File from Assembler Source
  125.  
  126.         HERCBIOS was originally developed on ASM 1.0. The version
  127.         included with this uses MASM 4.0. I don't know for sure whether
  128.         it will assemble with other versions of assembler.
  129.  
  130.         The commands for making HERCBIOS.COM from the source are in the
  131.         MAKEFILE included with the distribution. I run it with NDMAKE, an
  132.         excellent MS-DOS shareware MAKE from Don Knellers, but it should
  133.         be easy to adapt to your own favorite MAKE. If you make it by
  134.         hand, the commands are:
  135.  
  136.                 masm  hercbios;
  137.                 masm  gchar;
  138.                 masm  graph;
  139.                 link  hercbios gchar graph,  hercbios.exe;
  140.                 exe2bin  hercbios.exe hercbios.com
  141.                 del  hercbios.exe
  142.  
  143.         If you have a machine whose processor is an iAPX 286, 186, or
  144.         188, you may be able to get some increased performance and a
  145.         smaller .COM file by editing one character in the header file
  146.         hercbios.h. Simply remove the ";" that comments out the
  147.         definition of iAPX286. That will allow some non-8088 instructions
  148.         to assemble, as well as changing some code that was optimized for
  149.         speed (at the expense of storage and beauty) on the 8088. (This
  150.         option is known to assemble and link, but has not been tested; I
  151.         have no access to a 286 machine with Hercules graphics.)
  152.  
  153.  
  154.         Installing HERCBIOS.COM
  155.  
  156.         Once you have HERCBIOS.COM, store it where your PATH will find it
  157.         and add the line
  158.  
  159.                 HERCBIOS
  160.  
  161.         to your AUTOEXEC.BAT file somewhere after the PATH command. This
  162.         will cause it to be installed during boot, so it will be there
  163.         whenever you run your graphics programs. (Its presence won't
  164.         affect operation of your computer in alphanumeric mode, since it
  165.         passes on to the normal BIOS anything that's not in graphics
  166.         mode.)
  167.  
  168.         I am including a couple of demonstration/test programs in this
  169.         distribution, so that you can:
  170.            - See how to write programs for HERCBIOS.
  171.            - Test to assure that it runs with your computer and monitor.
  172.         The programs can be run in their executable form and their source
  173.         can be examined.
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.                                       - 3 -
  181.  
  182.  
  183.         COMPATIBILITY AND INCOMPATIBILITY
  184.  
  185.         HERCBIOS has been tested on a Hercules board in an IBM PC-XT, a
  186.         Hercules-compatible board I built from a SuperComputer bare
  187.         board, and a Leading Edge XT clone. The current version works
  188.         with